﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace UI
{
    public class BaseForm : Form
    {
        /// <summary>
        /// 校验输入
        /// </summary>
        /// <returns></returns>
        protected virtual bool CheckInput() { return false; }

        protected StringBuilder sbForErrorMsg = new StringBuilder();
        /// <summary>
        /// 对于为不能为空，但是值却是空的，拼成错误字符串
        /// </summary>
        protected bool NotNullEmpthCheck(string pValue, string pName)
        {
            bool ret = !string.IsNullOrEmpty(pValue);
            if (!ret)
            {
                sbForErrorMsg.AppendFormat("\"{0}\"不能为空", pName).AppendLine();
            }
            return ret;
        }
    }
}
